class BusinessError extends Error {
  code: number;
  constructor(message: string = '服务端错误！', code: number = 500) {
    super(message);
    this.name = this.constructor.name;
    this.code = code;
    Error.captureStackTrace(this, BusinessError);
  }
}

export default BusinessError;
